import request from "../common/request.js"

const get = (id)=>{
	return request({
		url:"order/getOrderInfoDetails",
		params:{id},
	})
}

const add = (info,details,couponId)=>{
	return request({
		url:"customer/addOrder",
		data:{info,details,couponId},
		method:'post'
	})
}

const getOrders = ()=>{
	return request({
		url:"order/getOrderInfo",
	})
}

const getBeforeOrders =()=>{
	return request({
		url:"order/GetCustomerOrders",
	})
}

const buy = (id,status)=>{
	return request({
		url:"order/buy",
		method:'post',
		params:{id,status}
	})
}

export default {
	add,
	getOrders,
	getBeforeOrders,
	buy,
	get
}
